package inputstream;


import org.junit.Test;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class ObjectInputSteam_ {
    @Test
    public void objectInputSteam01(){
        ObjectInputStream objectInputStream =null;
        try {
            objectInputStream = new ObjectInputStream(new FileInputStream("D:\\xuexi\\FileOutputStream01.dat"));
            System.out.println(objectInputStream.readBoolean());
            System.out.println(objectInputStream.readByte());
             System.out.println(String.valueOf((char)(objectInputStream.readByte())));
            System.out.println(objectInputStream.readChar());
            char chars=objectInputStream.readChar();

            System.out.println( chars);
            System.out.println(objectInputStream.readUTF());
            Object o =null;
            try {
                 o = objectInputStream.readObject();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }

            System.out.println(o.getClass());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
